/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.utilidad.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author angelquingaluisa
 */
@Entity
@Table(name = "provincia")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Provincia.findAll", query = "SELECT c FROM Provincia c"),
    @NamedQuery(name = "Provincia.findBycodigoPro", query = "SELECT c FROM Provincia c WHERE c.codigoPro = :codigoPro"),
    @NamedQuery(name = "Provincia.findBynombrePro", query = "SELECT c FROM Provincia c WHERE c.nombrePro = :nombrePro")})
public class Provincia implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @NotNull
    @Size(min = 1, max = 3)
    @Column(name = "codigo_pro")
    private String codigoPro;
    @Size(max = 45)
    @Column(name = "nombre_pro")
    private String nombrePro;
    
    public Provincia() {
    }

    public String getCodigoPro() {
        return codigoPro;
    }

    public void setCodigoPro(String codigoPro) {
        this.codigoPro = codigoPro;
    }

    public String getNombrePro() {
        return nombrePro;
    }

    public void setNombrePro(String nombrePro) {
        this.nombrePro = nombrePro;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codigoPro != null ? codigoPro.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Provincia)) {
            return false;
        }
        Provincia other = (Provincia) object;
        if ((this.codigoPro == null && other.codigoPro != null) || (this.codigoPro != null && !this.codigoPro.equals(other.codigoPro))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "clases.Provincia[ codigoPro=" + codigoPro + " ]";
    }
    
}
